<?php Tag::css('scaffold');  ?>
<div id="scaffold">
    
    <?php View::content(); ?>
    <h1>Video: <span>editar</span></h1>
        <?php echo Form::open(null, 'post', 'class="scaffold"') ?>
        <label for="videos_titulo" class="required">Titulo <em>*</em></label>
        <?php echo Form::text('videos.titulo') ?>        
        <label for="videos_descripcion" class="required">Descripcion <em>*</em></label>
        <?php echo Form::text('videos.descripcion',"style='width:430px; height:80px;'")?>        
        <label for="videos_video" class="required">Video <em>*</em></label>
        <?php echo Form::text('videos.video') ?>     
        <label for="videos_img" class="required">Imagen <em>*</em></label>
        <?php echo Form::text('videos.img') ?>                                    
        <label for="videos_categorias" class="required">Categoria <em>*</em> </label>       
        <?php echo Form::dbSelect('categorias_id', 'nombre',array('categorias', 'find'), '-- seleccione categoria --','',$categoria) ?>
        <div id="div_subcategoria">
        <label for="videos_subcategorias" class="required">Subcategorias <em>*</em> </label>       
        <?php echo Form::dbSelect('videos.subcategorias_id', 'nombre',array('subcategorias', 'find'), '-- seleccione subcategoria --') ?>
        </div>
        <label for="videos_estatus" class="required">Estatus <em>*</em></label>       
        <?php echo estatus::select('videos') ?>    
        <?php echo Form::hidden('videos.id') ?>    
        <input type="submit" value="Enviar" />
        <?php echo Form::close() ?>
    <div class="actions">
        <?php echo Html::linkAction('index', 'Listar') ?>
    </div>
</div>

<script type='text/javascript'>
$("#categorias_id").change(function(){ // Asigna el evento change al combo de marcas
	var categoria_id 	=	$('#categorias_id').val();
        $.json({
          type: "POST",
          url: "<?php echo PUBLIC_PATH . 'index/getSubcategorias/'; ?>",
          data: "categoria_id=" + categoria_id,
          contentType: "application/json; charset=utf-8", 
          dataType: "json", 
          success: function(html){
            $("#div_subcategoria").html(html);
          }
        });
});
</script>